local wu__longdou = fk.CreateSkill {
  name = "wu__longdou",
}

Fk:loadTranslationTable{
  ["wu__longdou"] = "笼斗",
  [":wu__longdou"] = "出牌阶段限一次，你可以与一名其他角色各摸一张牌，然后视为对其使用一张【决斗】。",
  ["#wu__longdou-active"] = "笼斗：请选择一名其他角色，你与其各摸一张牌，然后视为对其使用一张【决斗】。",
}

wu__longdou:addEffect("active", {  
  anim_type = "offensive",
  prompt = "#wu__longdou-active",
  
  max_phase_use_time = 1,
  target_num = 1,
  
  target_filter = function(self, player, to_select, selected)
    if to_select == player then
        return false
    end
    if not to_select:isAlive() then
        return false
    end
    return #selected == 0
  end,

  on_use = function(self, room, effect)
    local player = effect.from
    local target = effect.tos[1]

    local tos = {player, target}
    room:sortByAction(tos)

    for _, p in ipairs(tos) do
      if not p.dead then
        room:drawCards(p, 1, wu__longdou.name)
      end
    end

    if not player.dead and not target.dead then
      room:useVirtualCard("duel", nil, player, target, wu__longdou.name)
    end

    return false
  end,
})

return wu__longdou